package cn.dkdoo.utils.common;

public class Pager {

    private Integer pageSize;
    private Integer pageNo;
    private Long total;

    public Pager(Integer pageSize, Integer pageNo, Long total) {
        this.pageNo = pageNo == null ? 1 : pageNo;
        this.pageSize = pageSize == null ? 10 : pageSize;
        this.total = total;
    }

    public Pager() {
        this.pageNo = 1;
        this.pageSize = 10;
        this.total = 0l;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public int makeSkip() {
        return (this.getPageNo() - 1) * this.getPageSize();
    }
}